# 绘制箱线图
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd

df = pd.read_csv('no_neg_DBSCAN.csv')

# List of numerical features in the dataset
numerical_features = ['Temperature', 'Humidity', 'PM2.5', 'PM10', 'NO2', 'SO2', 'CO', 'Proximity_to_Industrial_Areas', 'Population_Density']

# Set up the plotting area
plt.figure(figsize=(15, 10))

# Create boxplots for each numerical feature
for i, feature in enumerate(numerical_features, 1):
    plt.subplot(3, 3, i)  # Adjust grid dimensions based on the number of features
    sns.boxplot(data=df, y=feature)
    plt.title(f"Boxplot of {feature}")
    plt.tight_layout()

plt.show()